import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('../views/LoginView.vue')
    },
    {
      path: '/main',
      name: 'main',
      component: () => import('../views/MainView.vue'),
      redirect: '/index',
      children: [
        {
          path: '/index',
          name: 'index',
          component: () => import('../views/IndexView.vue')
        },
        {
          path: '/business',
          name: 'business',
          component: () => import('../views/admin/BusinessView.vue')
        },
        {
          path: '/users',
          name: 'users',
          component: () => import('../views/admin/users/UserList.vue')
        },
        {
          path: '/roles',
          name: 'roles',
          component: () => import('../views/admin/roles/RoleList.vue')
        },
        {
          path: '/userAddRoles',
          name: 'userAddRoles',
          component: () => import('../views/admin/users/UserAddRoles.vue')
        },
        {
          path: '/rooms',
          name: 'rooms',
          component: () => import('../views/bussiness/room/RoomList.vue')
        },
        {
          path: '/club',
          name: 'club',
          component: () => import('../views/club/ClubList.vue')
        },
        {
          path: '/test',
          name: 'test',
          component: () => import('../views/club/TestView.vue')
        }
      ]
    }
  ]
})

export default router
